package Library;

/*1.Book类定义了书的属性(bookname,type,isBorrow, author, price,username)
并且提供空参构造器、有参构造器、get和set以及toString方法。*/

/**
 * 
 */
public class Book {

	public Book() {
	}

	public Book(String bookname, String type, int isBorrow, String author, int price, String username) {

		this.bookname = bookname;
		this.type = type;
		this.isBorrow = isBorrow;//1代表已借出，0代表还没借出
		this.author = author;
		this.price = price;
		this.username = username;
	}

	private String bookname;
	private String type;
	private int isBorrow;
	private String author;
	private int price;
	private String username;

	public String getBookname() {
		return bookname;
	}

	public void setBookname(String bookname) {
		this.bookname = bookname;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getIsBorrow() {
		return isBorrow;
	}

	public void setIsBorrow(int isBorrow) {
		this.isBorrow = isBorrow;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	//用来返回书籍信息
	public String searchBook() {
		return "Book {bookname=" + bookname + ", type=" + type + ", isBorrow=" + isBorrow + ", author=" + author
				+ ", price=" + price + ", username=" + username + "}";
	}
	
	@Override
	public String toString() {
		return "Book {bookname=" + bookname + ", type=" + type + ", isBorrow=" + isBorrow + ", author=" + author
				+ ", price=" + price + ", username=" + username + "}";
	}

}
